package com.example.shiro.quartz;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @ Author     ：jujh
 * @ Date       ：Created in 9:27 2018/11/2
 * @ Description：
 */
@Component
public class Timer {

    @Scheduled(cron = "2 * * * * *")
    public void timer() {
        System.out.println("now time:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
    }
}
